<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
    
        function Deng(name, wife){
            var prepareWife = "xiaozhang";
            //私有化变量
            this.name = name;
            this.wife = wife;
            this.divorce = function() {
                this.wife = prepareWife;
            };
            this.changePrepareWife = function(target) {
                prepareWife = target;
            };
            this.sayPrepareWife = function () {
                console.log(prepareWife);
            }
        }
        
        var deng = new Deng('deng','xiaoliu');
    
    
    
    
    </script>
</body>
</html>